<template>
  <div class="common-tabs">
    <ul class="common-tabs__ul clearfix">
      <li v-for="item in tabs" :key="item.value" :class="{'common-tabs__li': 1, 'active':current===item.value}" @click="clickTab(item)">{{item.label}}</li>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'common-tabs',
  props: {
    tabs: {
      type: Array,
      default: []
    }
  },
  data () {
    return {
      current: ''
    }
  },
  methods: {
    clickTab (item) {
      this.current = item.value
      this.$emit('tab-click', item)
    }
  }
}
</script>
<style scoped>
.common-tabs__ul {
  padding-left: 10px;
  /* border-bottom: 1px solid #0064e4; */
  display: flex;
  position: relative;
  padding-top: 21px;
  background: #fff;
}
.common-tabs__ul::before {
  display: block;
  content: "";
  height: 1px;
  background-color: #0064e4;
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
}

.common-tabs__li:first-child {
  border-top-left-radius: 5px;
}
.common-tabs__li {
  height: 50px;
  border: 1px solid #bfbfbf;
  border-bottom-color: #0064e4;
  padding: 0 10px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
}
.common-tabs__li:not(:last-child) {
  border-right-color: transparent;
}
.common-tabs__li.active {
  color: #0064e4;
  border-color: #0064e4 !important;
  background-color: #fff;
  border-bottom-color: #fff !important;
  z-index: 2;
}
</style>
